export function convertLevelData(level) {
  if (level) {
    const resultData = {
      label: level.indexName,
      value: level.indexName,
      pidName: level.pidName,
    }
    let children = []
    if (level.childList && level.childList.length) {
      children = level.childList.map((cItem) => {
        return convertLevelData(cItem)
      })
    }
    if (children.length) {
      resultData.children = children
    }
    return resultData
  }
}
